#ifndef CHATITEM_H
#define CHATITEM_H

#include <QWidget>
#include <QString>
#include <QDateTime>

#include <chatwidget.h>
#include <message.h>

namespace Ui {
class ChatItem;
}

class ChatItem : public QWidget
{
    Q_OBJECT

public:
    explicit ChatItem(QWidget *parent = nullptr);
    ~ChatItem();

    void setItemData(QString username, QDateTime timestamp, QString latestMessage);
    void setItem(Message);
    void setName(QString);
    void setTimestamp(QDateTime);
    void setLatestMessage(QString);
    void mousePressEvent(QMouseEvent *event);

    void setChatWidget(ChatWidget *newChatWidget);

    ChatWidget *chatWidget() const;

private:
    Ui::ChatItem *ui;

    ChatWidget *m_chatWidget;
};

#endif // CHATITEM_H
